
<?php
extract ($data);

//if (isset($category['ReclamationCategory']['id']) && $ReclamationCategory['id'] == $category['ReclamationCategory']['id']) { 
////     $tree->addItemAttribute('class', 'active'); // highlight this li 
//	$active = 'active';
//}else{
//	$active = 'off';
//}

//echo $html->link($TerminalCategory['name'], array('action' => 'select', $TerminalCategory['id']),array('class'=>'off'));
//$tree->addItemAttribute('id', 'selected-li-'.$TerminalCategory['id']); // highlight this li 
?>

<?php 
	$lastChild = (isset($data['children']) && count($data['children']) == 0 ) ? $lastChild = true : false;
?>

<span onmouseover="$('#menu-category-<?php echo $TerminalCategory['id']?>').css('display','block');" onmouseout="$('#menu-category-<?php echo $TerminalCategory['id']?>').css('display','none');" >
	<div class="inline right hidden"  id="menu-category-<?php echo $TerminalCategory['id']?>">
		<div class="admin-menu">
			<?php echo $html->link( $html->image('terminal.cake/view.png', array('alt'=>__d("views_elements","view",true),'title'=>__("wyswietl produkty tej kategorii",true))),array('action'=>'products_index',$TerminalCategory['id']), array('class'=>'right','escape'=>false), null, false);?>
			<?php if($lastChild) echo $html->link( $html->image('terminal.cake/add.png', array('alt'=>__d("views_elements","dodaj",true),'title'=>__("dodaj nowy produkt do tej kategorii",true))),array('action'=>'products_add',$TerminalCategory['id']), array('class'=>'right','escape'=>false), null, false);?>			
			<?php if($lastChild) echo $html->link( $html->image('terminal.cake/del.png', array('alt'=>__d("views_elements","usun",true),'title'=>__("usun wszystkie produkty z tej kategorii",true))),array('action'=>'products_all_del',$TerminalCategory['id']), array('class'=>'right','escape'=>false),sprintf(__d("views_elements","Czy napewno usunac wszystkie produkty kategorii: %s?",true), $TerminalCategory['name']),false);?>
		</div>
	</div>
	<?php echo $TerminalCategory['name']?>
</span>